<style>	
    body{
        height:100%;
        background:url(images/background.jpg);
        background-size:cover
    }
    #pic{
	position:absolute;
	top:100px
    }
</style>

<img id="pic"
     style="right:100px;"
     src="images/1 (1).png" />

<script>
    var i = 1;
    function f(){
        if(i==32) i = 1;
        pic.src = "images/1 ("+i+").png";
        i++;
    }
    setInterval(f,100);
     var j=100;
    function y(){
                if(j==1100){
		clearInterval(timer);
	}else{
	   pic.style="right:"+j+"px";
	    j=j+2;
	}
	
}
   timer=setInterval(y,100);
	
</script>
